//
//  BasePublicMethord.h
//  duoErMei
//
//  Created by Jack's Mac on 2016/12/29.
//  Copyright © 2016年 Jack. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import "CommonCrypto/CommonDigest.h"
typedef enum : NSUInteger {
    TKCTelephoningTypeApplicationWebView = 0,//在手机电话APP拨打，先在本APP内弹窗提示，需确认拨打。
    TKCTelephoningTypeApplication,//在手机电话APP直接拨打，无提示。结束通话后返回当前APP界面
    TKCTelephoningTypeApplicationTelprompt,//在手机电话APP拨打，先在本APP内弹窗提示，需确认拨打。听说此方法上架APP容易被拒？？
} TKCTelephoningType;


@interface BasePublicMethord : NSObject
//计算高度
+(CGRect)getSize:(NSString *)str fontSize:(CGFloat)font weith:(CGFloat)weith;




//返回时间差
+ (NSString *)intervalSinceNow: (NSString *) theDate;

//随机数生成方法
+(NSInteger)getRandomNumber:(NSInteger)from to:(NSInteger)to;

/**
 *  生成一个numcount位的随机数
 *
 *  @param Numcount <#Numcount description#>
 *
 *  @return <#return value description#>
 */
+ (NSString *)returnSuijiNumWithcount:(NSInteger)Numcount from:(NSInteger)startNum To:(NSInteger)endNum;

//,没有使用代理的提示框,,有参数传递
+(void)showAlviewUI:(NSString *)showMessageString;

//获取时间戳数据
//获取时间戳
+ (NSString *)getDataString;

//获取一个时间点字符串
+(NSString *)getTimeDataPointString;

//把json字符串转化成数组或者字典
+(id)parseJSONStringToNSDictionary:(NSString *)JSONString;

// 根据图片url获取图片尺寸
+(CGSize)getImageSizeWithURL:(id)imageURL;
//  获取PNG图片的大小
+(CGSize)getPNGImageSizeWithRequest:(NSMutableURLRequest*)request;
//  获取gif图片的大小
+(CGSize)getGIFImageSizeWithRequest:(NSMutableURLRequest*)request;
//  获取jpg图片的大小
+(CGSize)getJPGImageSizeWithRequest:(NSMutableURLRequest*)request;

//判断邮箱
+(BOOL)isValidateEmail:(NSString *)email;

//判断手机号码
+ (BOOL)isMobileNumber:(NSString *)mobileNum;

//把数组转化成json格式的字符串
+(NSString *)jsonArraytoJsonStr:(NSArray *)array;
+(NSString *)returnJsonStrFromJsonArr:(NSArray *)array;

//把数组转化成json格式的字符串dierzhong
+(NSString *)jsonArraytoJsonStrTwo:(NSArray *)array;

//base64转码
+(NSString *)imageBase64WithDataURL:(UIImage *)image;



//生成订单号
/*  生成商品订单号  */
+ (NSString *)generateTradeNo;

//获取两个日期的时间间隔(返回大具体的时间精确到秒)
+(NSString *)getDataTimeform:(NSString *)showTimeStr;

//获取两个日期的时间间隔(返回大致时间, 精确到天)
+(int)getDayTimeform:(NSString *)showTimeStr anotherBigtime:(NSString *)bigTimeStr;

//获取两个日期的时间间隔(返回大致时间, 有文字)
+(NSString *)getDayTimeStringform:(NSString *)showTimeStr anotherBigtime:(NSString *)bigTimeStr;

//获取两个日期的时间间隔(返回大致时间字典)
+(NSDictionary *)getDayTimeDicform:(NSString *)showTimeStr anotherBigtime:(NSString *)bigTimeStr;
// 字典转json字符串方法

+(NSString *)convertToJsonData:(NSDictionary *)dict;



//获取当前日期N天(前或者后)的日期
+(NSString *)getDatafromCount:(NSInteger )dayCount addOrReduce:(NSString *)judge;

/**
 拨打电话
 
 @param phoneNum        电话号码
 @param telephoningType 拨打类型 见TKCTelephoningType
 */
+ (void)userTelephoningNum:(NSString *)phoneNum type:(TKCTelephoningType)telephoningType;


//数组排序
+(NSArray *)returnSortArrayFromArray:(NSArray *)tempArray;


//MD5加密
+(NSString *)md5:(NSString *)inPutText;


+ (float) heightForString:(NSString *)value andWidth:(float)width;
//计算year年month月第一天是星期几，周日则为0
+(int)GetTheWeekOfDayByYera:(int)year andByMonth:(int)month;

//获取当前时间数据字典格式分开的数据形式
+(NSDictionary *)getNowDataDic;

//获取具体的某一天是周几(第几天, 周日是1)
+(NSInteger )returnWeekDayIntFormyear:(NSString *)year month:(NSString *)month day:(NSString *)day;
//获取具体的莫一天是周几字符类型
+(NSString *)returnWeekDayStrFormyear:(NSString *)year month:(NSString *)month day:(NSString *)day;



+(NSString *)returnStrAddZeorFromStr:(NSString *)string;
//16进制颜色值
+ (UIColor *)getColor:(NSString *)hexColor;

//密码判断
+(BOOL)judgePasswordWith:(NSString *)transStr;

//根据车牌号显示车辆的限行问题
+(NSString *)getXXStringWith:(NSString *)provinceStr number:(NSString *)numberStr;

/**
 * 开始到结束的时间差
 */
+ (NSString *)dateTimeDifferenceWithEndTime:(NSString *)endTime;


//身份证号验证
+ (BOOL)checkValid:(NSString*)tarStr;

@end
